#include <bits/stdc++.h>
#include "testlib.h"

using namespace std;

int main(int argc, char* argv[]) {
    registerValidation(argc, argv);
    int group = atoi(validator.group().c_str());
    if (group == 0) group = 1;
    ensure (group == 1 || group == 2);
    long long maxm = (group == 2) ? 1000000000000000000ll : 1000000;
    long long m = inf.readLong(1, maxm, "M");
    inf.readEoln();
    inf.readLong(m, maxm, "N");
    inf.readEoln();
    inf.readEof();
}
